//个人信息
var personInfo = {
	// 上方背景
	bg: "../img/person/personal%20center_photo_top.png",
	// 名称
	name: "小陈的旅拍故事",
	// 头像
	headImg: "../img/person/personal%20center_photo_head%20portrait.png",
	// 个性签名
	text: "摄影是爱好也是终生追逐的梦想",
	// 勋章图片
	labelImg: "../img/person/personal%20center_photo_badge%20background.png",
	// 勋章级别
	label: "小萌新",
	// 粉丝
	fans: 6842,
	// 关注
	focus: 342,
	// 收藏
	collection: 1648,
	// 访客
	visitors: 646
}
//相册影集
var photoCollectList = [{
		// 图片
		photoImg: "../img/person/my%20lbum_img.png",
		//数量
		count: 246,
		// 图集名称
		photoName: "旅行的故事"
	},
	{
		photoImg: "../img/person/my%20lbum_img.png",
		count: 246,
		photoName: "旅行的故事"
	},
	{
		photoImg: "../img/person/my%20lbum_img.png",
		count: 246,
		photoName: "旅行的故事"
	},
]
// “动态”数据
var myDynamicList = [{
	// 月份
	month: "12",
	// 天
	day: "04",
	// 标题
	title: "摄影构图学习打卡第七天",
	// 文本内容
	text: "通过分析摄影常用构图来体会摄影构图元素的比例，近似色配色让人感觉画面和谐，再添加点缀的互补色就能让画面更加丰...",
	// 图片
	imgs: ["../img/person/my%20dynamic_img1.png", "../img/person/my%20dynamic_img2.png",
		"../img/person/my%20dynamic_img3.png"
	]
}]
$(".labelBox").on("click",function(){
	window.location.href="../myMedal/myMedal.html"
})
// 个人信息
function getInfo() {
	$("#bg").attr("src", personInfo.bg)
	$("#headImg").attr("src", personInfo.headImg)
	$("#name").append(personInfo.name)
	$("#labelImg").attr("src", personInfo.labelImg)
	$("#label").append(personInfo.label)
	$("#text").append(personInfo.text)
	$(".fansCount").append(personInfo.fans)
	$(".focusCount").append(personInfo.focus)
	$(".collectCount").append(personInfo.collection)
	$(".visitorsCount").append(personInfo.visitors)
}
//相册影集
function getPhotoUl() {
	for (var i = 0; i < photoCollectList.length; i++) {
		$(".photoUl").append('<li><div class="imgBox"><img src=' + photoCollectList[i].photoImg +
			' class="photoImg" /><div class="iconBox"><div class="icon"></div><div class="count">' +
			photoCollectList[i].count + '</div></div></div><div class="photoName">' + photoCollectList[i].photoName +
			'</div></li>')
	}
}
// 动态
function getDynamicUl() {
	for (var i = 0; i < myDynamicList.length; i++) {
		$(".dynamicUl").append('<li><div class="timeBox"><div class="time"><div class="month">' +
			myDynamicList[i].month + '</div><div class="day">/' + myDynamicList[i].day +
			'</div></div><div class="pointLine"></div></div>' +
			'<div class="content"><p class="title">' + myDynamicList[i].title + '</p><p class="text">'+
			 myDynamicList[i].text +'</p>' +
			'<div class="dynamicImgBox"><div class="leftImgBox"></div><div class="rightImgBox"></div></div></div></li>')
		// 动态图片
		for (var j = 0; j < myDynamicList[i].imgs.length; j++) {
			var imgObj = new Image()
			imgObj.src = myDynamicList[i].imgs[j]
			var imgHeight = imgObj.height
			// console.log(imgHeight)
			if (imgHeight == 340) {
				$(".dynamicUl li:eq(" + i + ") .dynamicImgBox .leftImgBox").append('<img src=' + myDynamicList[i].imgs[j] +
					' class="myDynamicImg" />')
			} else {
				$(".dynamicUl li:eq(" + i + ") .dynamicImgBox .rightImgBox").append('<img src=' + myDynamicList[i].imgs[j] +
					' class="myDynamicImg" />')
			}

		}

	}
}
var all = {
	getInfo,
	getPhotoUl,
	getDynamicUl
}
all.getInfo()
all.getPhotoUl()
all.getDynamicUl()

